package com.baosf.serviceorder.config;

import feign.Logger;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class OrderServiceConfig {
    @LoadBalanced   // 注解式负载均衡
    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
//    设置feign日志级别
    @Bean
    Logger.Level feignLoggerLevel() {
        // FULL: 最详细的日志（请求头、请求体、响应头、响应体都会打印）
        return Logger.Level.FULL;
    }
}
